//
//  TestAbstract.java
//  joosVM
//
//  Created by Smári Waage on 15.12.2009.
//  Copyright 2009 smari.org. All rights reserved.
//

package abstractAndPolyTest;

public class TestAbstract {
	
	public static void RunTest(int size) {
		
		System.out.println("Start Test for inheritance and polymorphic calls");
		
	
		AbstractParent[] tests = new AbstractParent[size];
		
		for(int i=0;i<size;i++){
			int t = i%10;
			
			if(t == 0)
				tests[i] = new A();
			else if(t == 1)
					tests[i] = new B();
			else if(t == 2)
					tests[i] = new C();
			else if(t == 3)
					tests[i] = new D();
			else if(t == 4)
					tests[i] = new E();
			else if(t == 5)
				tests[i] = new F();
			else if(t == 6)
				tests[i] = new G();
			else if(t == 7)
				tests[i] = new H();
			else if(t == 8)
				tests[i] = new I();
			else if(t == 9)
				tests[i] = new J();
			
			
		}
		
		int collector =0;
		for(int i=0;i<size;i++){
			//System.out.println(tests[i].MethodA());
			collector += tests[i].MethodB();
		}
		
		System.out.println("End test");
		
		
		
	}
	

}
